﻿@{
	ViewBag.Title = "OrgCompany";
	Layout = "~/Views/Shared/_Layout.cshtml";
}
@model CNDreams.Web.Areas.ModuleSys.Models.MdoelOrgCompanyIndex
<script type="text/javascript">
    //添加企业信息
    function addOrgCompany() {
        window.top.openDialog({ Url: "/ModuleSys/OrgCompany/Create/?pageState=" + create, Title: "新增企业信息", Width: 750, Height: 500 });
    }

    //根据ID删除用户
    function deleteOrgCompany(OrgCompanyID) {
        top.window.$("#sysConfirm").html("确定要删除？");
        top.window.$("#sysConfirm").dialog({
            resizable: false,
            height: 200,
            title: "系统提示",
            modal: true,
            buttons: {
                "是": function () {
                    $.ajax({
                        type: "POST",
                        url: "/ModuleSys/OrgCompany/Delete",
                        data: "id=" + OrgCompanyID,
                        success: function (msg) {
                            msg = eval("(" + msg + ")");
                            if (msg.result == "") {
                                window.location = commonPage.getCurrentUrl();
                                window.top.sysMessage();
                            }
                            else {
                                window.top.sysAlert(msg.result);
                            }
                        }
                    });
                    top.window.$("#sysConfirm").dialog("close");
                },
                "否": function () {
                    top.window.$("#sysConfirm").dialog("close");
                }
            }
        });
    }
    //批量删除
    function deleteOrgCompanyBatch() {
        if (!defaultTable.isSelect())
            return;

        top.window.$("#sysConfirm").html("确定要删除？");
        top.window.$("#sysConfirm").dialog({
            resizable: false,
            height: 200,
            title: "系统提示",
            modal: true,
            buttons: {
                "是": function () {
                    $("form").ajaxFormUnbind();
                    $("form").attr("action", "/ModuleSys/OrgCompany/DeleteBatch/?RetUrl=" + escape(commonPage.getCurrentUrl())).submit();
                    top.window.$("#sysConfirm").dialog("close");
                },
                "否": function () {
                    top.window.$("#sysConfirm").dialog("close");
                }
            }
        });
    }

    //根据编号修改用户信息
    function editOrgCompany(OrgCompanyID) {
        window.top.openDialog({ Url: "/ModuleSys/OrgCompany/Create/?UTOrgCompanyID=" + OrgCompanyID + "&pagestate=" + edit, Title: "修改企业信息", Width: 750, Height: 500 });
    }
    //根据编号查看用户信息
    function show(OrgCompanyID) {
        window.top.openDialog({ Url: "/ModuleSys/OrgCompany/Create/?UTOrgCompanyID=" + OrgCompanyID + "&pagestate=" + detail, Title: "企业信息查看", Width: 750, Height: 500 });
    }
</script>
@using (Html.BeginForm())
{
	/* 工具栏
	 ----------------------------------------------------------*/
	<div class="toolbar">
		<div class="toolbar-left">
			@Html.Button(ButtonType.新增, "addOrgCompany()")
			@Html.Button(ButtonType.批量删除, "deleteOrgCompanyBatch()")
			@Html.Button(ButtonType.导出XLS, string.Format("defaultExport.showExportDialog('{0}')", Project.Common.StringUtility.EncodeBase64("CNDreams.Entity.UTOrgCompany")), "导出")
			@Html.Button(ButtonType.条件查询, "commonPage.scan()")
			
		</div>
		<div class="toolbar-right">
			@Html.TextBoxFor(x => x.SearchEntity._CommonSearchCondition, new { @class = "common-search-condition" })
			<input type="submit" class="common-search-submit" value="" />
		</div>
	</div>
	
	/* 模糊条件查询 search-container
     ----------------------------------------------------------*/
	<div class="search-container">
		<table>
			<tr>
				<th>
					组织机构代码：
				</th>
				<td>
					@Html.TextBoxFor(x => x.SearchEntity._CompanyCode, new { style = "width:100px" })
				</td>
				<th>
					企业名称：
				</th>
				<td>
					@Html.TextBoxFor(x => x.SearchEntity._CompanyName, new { style = "width:200px" })
				</td>
				<td class="search-button">
					<input type="submit" value="" class="button-search" />
					<input type="button" value="" class="button-clear" />
				</td>
			</tr>
		</table>
	</div>

     /* 说明文字
        ----------------------------------------------------------*/
        <div class="search-clue">
            您可通过该功能，维护所有租赁企业相关信息
        </div>
    
    /* 表格数据显示
      ----------------------------------------------------------*/
     <div class="replace-container">
			@{
	Html.RenderPartial("Index_Partial");
			}
		</div>
}
